#include "ObjectPark.h"
#include "Global.h"

namespace RisingStar
{

	CObjectPark::CObjectPark(TObjectProperty objPropert):CObject(objPropert)
	{		
		Init();
	}
	
	CObjectPark::CObjectPark()
	{
		Init();
	}
	
	CObjectPark::~CObjectPark()
	{

		
	}
	
	CObject::ObjectPtr CObjectPark::Copy()
	{
		//cout<<"CObjectPark Copy"<<endl;
		
		ObjectPtr pUser(new CObjectPark(mObjectProperty));
		*pUser = (*this);

		return pUser;
	}
	
	bool CObjectPark::Init()
	{
		nValues["对象类型"] = "车位";
		nValues["数据库类型"] = "手机";
		sGlobal.RequestCallbackMap["车位注册"] = CObjectPark::ObjectCallbackUserRegister;
		sGlobal.RequestCallbackMap["车位设定"] = CObjectPark::ObjectCallbackUserEdit;
		sGlobal.RequestCallbackMap["车位注销"] = CObjectPark::ObjectCallbackUserDel;
		sGlobal.RequestCallbackMap["车位出租"] = CObjectPark::ObjectCallbackUserEdit;
		return true;
	}
	
	bool CObjectPark::ObjectCallbackUserRegister(CObject* obj)
	{
		cout<<"车位注册函数调用成功"<<endl;
		return true;
	}
	bool CObjectPark::ObjectCallbackUserEdit(CObject* obj)
	{
		//cout<<"车位修改函数调用成功"<<endl;
		ObjectCallbackSqlEdit(obj);
		return true;
	}
	
	bool CObjectPark::ObjectCallbackUserDel(CObject* obj)
	{
		ObjectCallbackSqlDel(obj);

		return true;
	}
	
	
	
	bool CObjectPark::ObjectCallbackUserPasswordResetAndLogin(CObject* obj)
	{
		
		ObjectCallbackSqlAddOrEdit(obj);
		
		
		
		cout<<"密码重置并登录"<<endl;
		return true;
	}
	
	bool CObjectPark::ObjectCallbackUserPasswordLogin(CObject* obj)
	{
		
		
		cout<<"密码登录"<<endl;
		return true;
	}
	
	bool CObjectPark::ObjectCallbackUserIdentifyingCodeSend(CObject* obj)
	{
		cout<<"车位验证码发送"<<endl;
		return true;
	}
	
	
	
}

